package com.itheima.shengxiao3;

import com.itheima.shengxiao2.Desk;

import java.util.concurrent.ArrayBlockingQueue;

public class Chuzi implements Runnable {
   private ArrayBlockingQueue<String> queue;

    public Chuzi(ArrayBlockingQueue<String> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
                queue.put("一碗面");
                System.out.println("生产了一碗面");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
